<template>
   <div class="payresult">
        <wxc-minibar title="投注成功" ></wxc-minibar>
        
        <div class="betSuccess">
            <div style="display:flex;justify-content:center;align-items:center;margin-top:90px;margin-bottom:70px;">
                <image style="width:290px;height:323px;" src="http://zhongcai-test.oss-cn-beijing.aliyuncs.com/hch5/paysuccess.png"></image>
                <text style="font-family: PingFangSC-Medium;font-size: 40px;color: #333333; margin-top:48px">恭喜你，投注成功</text>
            </div>
            <div class="gopay">
                <div class="gopay_button" @click="gobuy()">
                    <text style="font-family: PingFangSC-Medium;font-size: 32px;color: #FFFFFF;">继续购买</text>
                </div>
            </div>
            <div class="gopay">
                <div class="gopay_button1">
                    <text style="font-family: PingFangSC-Medium;font-size: 32px;color: #666666;">分享攒好运</text>
                </div>
            </div>
            <div class="gopay">
                <div class="gopay_button1">
                    <text style="font-family: PingFangSC-Medium;font-size: 32px;color: #666666;">赠送好友</text>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import WxcMinibar from "@/components/modules/wxc-minibar/index.js";
const storage = weex.requireModule("storage");
var sxglobalEvent = weex.requireModule("globalEvent");
import { serialize, getBaseUrl, jsonAnalysis, getUserInfoModel } from "@/utils/index.js";
const navigator = weex.requireModule("navigator");
const modal = weex.requireModule("modal");

export default {
  data() {
    return {};
  },
  created() {
    this.getAllkesTab().then(value => {
      value.forEach((item, index) => {
        if (item.indexOf("numberlist") > -1) {
          storage.removeItem(item, e => {
            console.log(e);
          });
        }
      });
    });
  },
  mounted() {
    getUserInfoModel()
    this.addListtener();
  },
  components: {
    WxcMinibar
  },
  destroyed() {
    // sxglobalEvent.removeEventListener("androidback");
  },
  methods: {
    router() {
      navigator.pop();
    },
    getAllkesTab() {
		return new Promise((resolve, reject) => {
			storage.getAllKeys(event => {
				if (event.result != "success") return false;
				if (event.data && event.data.length > 0) {
					resolve(event.data);
				}
			});
		});
    },
    gobuy() {
		let baseurl = getBaseUrl(weex.config.bundleUrl, true);
		if( weex.config.env.platform === 'ios') {
			navigator.popToRootView()
		} else {
			navigator.push({
				'url': baseurl + 'index.js',
				'animated': 'true'
			})
		}
    //   let jUrl = baseurl + `index.js`;
    //   var params = {
    //     url: jUrl,
    //     animated: "true"
    //   };
    //   navigator.push(params);
    },
    addListtener() {
      // sxglobalEvent.addEventListener('androidback',e => {
      // })
    }
  }
};
</script>
<style scoped>
.header {
  width: 750px;
  height: 90px;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.header-img {
  position: absolute;
  left: 32px;
  margin-left: 0;
}

.header-title {
  font-size: 34px;
  color: #fff;
  font-weight: 600;
  font-family: PingFangSC-Medium;
}
.payresult {
  position: absolute;
  background-color: rgb(245, 245, 245);
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.gopay {
  height: 80px;
  padding-left: 187px;
  padding-right: 187px;
  margin-bottom: 48px;
}
.gopay_button {
  background-color: #e70d0d;
  display: flex;
  height: 80px;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}
.gopay_button1 {
  border-width: 2px;
  border-style: solid;
  border-color: #f5f5f5;
  border-radius: 4px;
  display: flex;
  height: 80px;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  background-color: white;
}
</style>